<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

  <xsl:import href="../../../web/sys/resolver.xsl"/>
	
	<xsl:variable name="basePath" select="'/livcos.org/LivCos/web'"/>
	<xsl:variable name="dataPath" select="'/livcos.org/LivCos/data'"/>
	
  <!-- map special paths -->

	<xsl:template match="uri[@ext = 'pdf']" priority="0">
		<access obj="{$basePath}/fo/pdf" scope="view">
			<param key="ref" value="{@relativeName}"/>
		</access>
	</xsl:template>
	
	<!-- special views -->
  
	<xsl:template match="uri[@relative = 'example/BusinessPlan.html']">
		<access obj="{$basePath}/example/BusinessPlan" scope="view"/>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/example/BusinessPlan.html']">
		<access obj="{$basePath}/example/BusinessPlan" scope="view"/>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'Intro.html']">
		<access obj="{$basePath}/{@relativeName}" scope="view">
			<param key="ref" value="{$dataPath}/{@relativeName}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/Intro.html']">
		<access obj="{$basePath}/{@name}" scope="view">
			<param key="ref" value="{$dataPath}/{@name}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'News.html']">
		<access obj="{$basePath}/{@relativeName}" scope="view">
			<param key="ref" value="{$dataPath}/{@relativeName}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/News.html']">
		<access obj="{$basePath}/{@name}" scope="view">
			<param key="ref" value="{$dataPath}/{@name}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'Journal.html']">
		<access obj="{$basePath}/{@relativeName}" scope="view">
			<param key="ref" value="{$dataPath}/{@relativeName}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/Journal.html']">
		<access obj="{$basePath}/{@name}" scope="view">
			<param key="ref" value="{$dataPath}/{@name}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'PublicIntro.html']">
		<access obj="{$basePath}/{@relativeName}" scope="view">
			<param key="ref" value="{$dataPath}/{@relativeName}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/PublicIntro.html']">
		<access obj="{$basePath}/{@name}" scope="view">
			<param key="ref" value="{$dataPath}/{@name}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[matches(@relative, 'pm/Roadmap.*\.html$')]">
		<access scope="view" obj="{$basePath}/document">
			<source obj="{$basePath}/pm/Roadmap_prep" scope="view">
				<param key="ref" value="{$dataPath}/pm/{@name}"/>
			</source>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[matches(@relative, 'pm/Roadmap.*\.pdf$')]">
		<access scope="view" obj="{$basePath}/fo/pdf">
			<source obj="{$basePath}/pm/Roadmap_prep" scope="view">
				<param key="ref" value="{$dataPath}/pm/{@name}"/>
			</source>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'project/Cosmos/design/ObjectModel.html']">
		<access scope="view" obj="{$basePath}/document">
			<source obj="/livcos.org/web/style/rd/UmlDiagram" scope="view">
				<param key="ref" value="{$dataPath}/{@relativeName}"/>
			</source>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/project/Cosmos/design/ObjectModel.html']">
		<access scope="view" obj="{$basePath}/document">
			<source obj="/livcos.org/web/style/rd/UmlDiagram" scope="view">
				<param key="ref" value="{$dataPath}/project/Cosmos/design/ObjectModel"/>
			</source>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'project/Cosmos/design/ObjectModel.pdf']">
		<access scope="view" obj="{$basePath}/fo/pdf">
			<source obj="/livcos.org/web/style/rd/UmlDiagram" scope="view">
				<param key="ref" value="{$dataPath}/{@relativeName}"/>
			</source>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'livcos.org/LivCos/data/project/Cosmos/design/ObjectModel.pdf']">
		<access scope="view" obj="{$basePath}/fo/pdf">
			<source obj="/livcos.org/web/style/rd/UmlDiagram" scope="view">
				<param key="ref" value="{$dataPath}/project/Cosmos/design/ObjectModel"/>
			</source>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@relative = 'snapshot/generate.job']">
		<access obj="{$basePath}/{@relativeName}" scope="view"/>
	</xsl:template>
	
</xsl:stylesheet>